' ' ROLLING FORECAST 
'scalar total=186
'scalar window=150       
'matrix(total,1) results
'series cvarf
'
'for !i=window to total-2
'	smpl @first+!i-window  @first+!i-1
'	equation garch_n
'	garch_n.arch(1,1) d2vnibor c
'	garch_n.makegarch garch1
'	smpl @first+!i @first+!i+2
'	garch_n.forecast(f=na) cvarf
'	smpl @all
'	results(!i+2,1)=cvarf(!i+2)
'next

'' TEST p,q in ARMA
scalar i
scalar j
smpl @first @first+121
matrix(5,5) aic
matrix(5,5) dw
matrix(5,5) schwarz
matrix(5,5) maxPval

for i = 1 to 5
	for j = 1 to 5		
		!t1 = @mod(i,5) ' 5 is no
		!t2 = @mod(j,5)
		equation e.arch(1,1,tdist=3) d(vnibor1m) ar(1 to !t1) ma(1 to !t2) c
'		equation e.ls d(vnibor1m) ar(1 to !t1)  ma(1 to !t2) c
		aic(i,j) = e.@aic
		dw(i,j) = abs(e.@dw-2)
		schwarz(i,j) = e.@schwarz
		maxPval(i,j) = @max(e.@pval)
	next
next

show maxPval
show dw
show schwarz
show aic
